package com.mdb.open.trade.service.trade;


/*
* Copyright (C), 2017-2019 澳发科技(MDB)
* FileName: TfCusAccService.java
* Author:   you.yichao
* Date:     2019-07-15
* History:
* <author>          <time>          <version>          <desc>
* you.yichao         2019-07-15          V1.00             代码生成器初始生成代码
* -----------------------------------------------------------
* 作者姓名           修改时间           版本号            描述
*/


import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mdb.bc.api.data.ResultEx;
import com.mdb.bc.database.mybatisplus.SuperService;
import com.mdb.open.common.enums.trade.status.CusAccStatusEnum;
import com.mdb.open.trade.common.MdbDataSource;
import com.mdb.open.trade.config.AccountingDateUtil;
import com.mdb.open.trade.domain.po.trade.CusAcc;
import com.mdb.open.trade.mapper.trade.TfCusAccMapper;
import com.mdb.open.trade.service.trade.handle.DDAccHandle;
import com.mdb.open.trade.service.trade.handle.LoanHandle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 类描述：
 *  融资客户账户表 服务类
 *
 * @author you.yichao
 * @date 2019-07-15
 */
@Service
@DS(MdbDataSource.TRADE)
public class TfCusAccService extends SuperService<TfCusAccMapper, CusAcc> {

    @Autowired
    DDAccHandle dDAccHandle;

    @Autowired
    LoanHandle loanHandle;

    @Autowired
    AccountingDateUtil accountingDateUtil;

    public ResultEx<CusAcc> getByCustomerCode(String customerCode) {
        return ResultEx.ok(this.baseMapper.selectOne(new LambdaQueryWrapper<CusAcc>()
                .eq(CusAcc::getCustomerCode, customerCode)
                .eq(CusAcc::getStatus, CusAccStatusEnum.NORMAL)));
    }


}
